/**
 * Created by alice on 2017/5/02 0001
 */
;-function (window) {
    "use strict";
    //TODO 预设变量写这里，全局变量写在base.js 里面 使用 r. 调用
    var ready = {
        cityCode: [],
        height: $(document).height(),
        width: $(document.body).width(),
        html: $("#_court_day").clone(),
        review_html: $("#_row_review_div").clone(),
        nowyear: null,
        _countCount_chart: null,
        _countTime_chart: null,
        _tec_copy: null,
        _nowyear: new Date()

    };
    //TODO 初始化的方法写这里面
    var init = function () {
        init_ready();//加载预设变量
        init_event();

        function init_event() {//TODO 初始化页面事件

            // $("#showToday").click(function () {
            //     Class.getCaseInfoForToday(1, r.flag_search ? null : r.courtUid);
            // });
            // $("#showTomorrow").click(function () {
            //     Class.getCaseInfoForToday(2, r.flag_search ? null : r.courtUid);
            // });

            $(".container-fluid").show();
            $(".map-right-bottom").tooltip();
            $(".fa-youtube-play").tooltip();

            $('.fa-arrow-left').on('click', function () {
                base.back();
            });

            $('#_myTab').find('li').click(function (e) {
                e.preventDefault();
                $('#_myTab').find('li').removeClass('active');
                $(this).addClass("active");
                console.log(this.tabIndex);
                $('.right-tab').find('.right-tab-child').hide();
                $('.right-tab').find('.right-tab-child').eq(this.tabIndex).show();
                if (this.tabIndex === 0) {
                    ready._countCount_chart.resize();
                } else if (this.tabIndex === 1) {
                    ready._countTime_chart.resize();
                }
            });
            $('#_countCount_chart').click(function () {
                window.location.href = r.base_path + "case_count/open_court_number_count?courtUid=" + r.court_uid;
            });
            $('#_countTime_chart').click(function () {
                window.location.href = r.base_path + "case_count/open_court_time_count?courtUid=" + r.court_uid;
            });
            $('#courtNumberCount').click(function () {
                window.location.href = r.base_path + "case_count/open_court_number_count?courtUid=" + r.court_uid;
            });
            Class.init();
            //点击更多视频庭审回顾页
            // $(".more_video").click(function () {
            //     window.location.href = encodeURI(r.base_path + "more/more_review?courtUid=" + r.court_uid);
            // });
            $("#review_link").attr("href", r.base_path + "more/more_review?courtUid=" + r.court_uid);
            var now = new Date();
            var month = (now.getMonth() + 1);
            var day = now.getDate();
            if (now.getMonth() < 10) {
                month = "0" + (now.getMonth() + 1);
            }
            if (now.getDate() < 10) {
                day = "0" + now.getDate();
            }
            var startDate = now.getFullYear() + "-01-01";
            var endDate = now.getFullYear() + "-" + month + "-" + day;
            $('#judge_trial_url').attr('href', r.base_path + 'judge_Info/judge_count_info?courtUid=' + r.court_uid + "&startDate=" + startDate + "&endDate=" + endDate);

            $(".fa-home").click(function () {
                utils.set_cookie("_search", 1);
                window.location.href = r.base_path + "index";
            });

        }

        function init_ready() {//TODO 初始化预设值
            utils.set_cookie("_search", 0);
            r.flag_search = false;
            ready.nowyear = ready._nowyear.getFullYear() + "-01-01";
            ready._countCount_chart = echarts.init(document.getElementById('_countCount_chart'), "macarons");
            ready._countTime_chart = echarts.init(document.getElementById('_countTime_chart'), "macarons");
            ready._tec_copy = $("#_tec_copy").clone();

        }
    };
    //TODO 内部调用的方法写这里
    var Class = {
        init: function () {
            $("#loading").show();
            Class._initSumCount();
        },
        getCity: function () {
            $.ajax({
                url: r.base_path + "index/GetCity",
                type: "post",
                dataType: "json",
                data: {
                    courtId: r.court_id
                },
                async: false,
                success: function (data) {
                    // console.log(data);
                    ready.cityCode = data.data;
                }
            }).fail(function () {
                layer.msg('加载失败!');
                $('#loading').hide();
            });
        },
        /**
         * 今日直播案件
         */
        getCaseInfoForToday: function (flag) {
            if (flag == 2) {
                $("#left-tab-2").find(".left-tab-row").html('<p class="text-left court-room" ><span class="more-errmsg">暂无开庭</span></p>');
                $("#left-tab-1").hide();
                $("#left-tab-2").find(".cmp-left-tabs-link").find("a").attr("href", encodeURI(r.base_path + "views/more_courting.html?flag=" + flag + "&city=" + r.court_id + "&court=" + r.court_id));
                $("#left-tab-2").show();
            } else {
                $("#left-tab-1").find(".left-tab-row").html('<p class="text-left court-room" ><span class="more-errmsg">暂无开庭</span></p>');
                $("#left-tab-2").hide();
                $("#left-tab-1").find(".cmp-left-tabs-link").find("a").attr("href", encodeURI(r.base_path + "views/more_courting.html?flag=" + flag + "&city=" + r.court_id + "&court=" + r.court_id));
                $("#left-tab-1").show();
            }

            if (flag == 2) {
                $("#left-tab-2").find(".left-tab-row").empty();
                $("#left-tab-1").hide();
                $(tomorrowCase).each(function (index, elem) {
                    var startDate = elem.start_date.substring(0, elem.start_date.length - 2);
                    !elem.courtroom_name ? elem.courtroom_name = "未知" : "";
                    var html = '<div class="split col-md-6 col-sm-12 left-tab-item">'
                        + '    <a href="' + r.base_path + "views/system_monitor/living.html?uid=" + elem.uid + "&cid=" + elem.courtroom_id + "&flag=" + flag + "&city=" + r.court_id + "&court=" + r.court_id + "&vc=" + elem.courtId + '" >'
                        + '       <div class="row ">'
                        + '          <div class="col-xs-4">'
                        + '               <div class="left-tab-item-img-panel">'
                        + '                 <div class="left-tab-item-img">'
                        + '                      <p>' + elem.statusName + '</p>'
                        + '                       <img src="' + r.base_path + 'assets/img/list_test2.jpg" alt="法院">'
                        + '                   </div>'
                        + '               </div>'
                        + '          </div>'
                        + '          <div class="col-xs-8">'
                        + '              <div class="left-tab-item-content-panel">'
                        + '                  <p class="left-tab-item-content-panel-title">' + elem.casename + '</p>'
                        + '                  <p class="left-tab-item-content-panel-room">' + elem.courtroom_name + '</p>'
                        + '                  <p class="left-tab-item-content-panel-type">' + elem.casetype_name + '</p>'
                        + '                  <p class="left-tab-item-content-panel-time">' + startDate + '</p>'
                        + '              </div>'
                        + '          </div>'
                        + '      </div>'
                        + '  </a>'
                        + '     </div>';

                    $("#left-tab-2").find(".left-tab-row").append(html);
                });
                $("#left-tab-2").find(".cmp-left-tabs-link").find("a").attr("href", encodeURI(r.base_path + "views/more_courting.html?flag=" + flag + "&city=" + r.court_id + "&court=" + r.court_id));
                $("#left-tab-2").show();
            } else {
                $("#left-tab-1").find(".left-tab-row").empty();
                $("#left-tab-2").hide();

                $(todayCase).each(function (index, elem) {
                    var startDate = elem.start_date.substring(0, elem.start_date.length - 2);
                    !elem.courtroom_name ? elem.courtroom_name = "未知" : "";
                    var html = '<div class="split col-md-6 col-sm-12 left-tab-item">'
                        + '    <a href="' + r.base_path + "views/system_monitor/living.html?uid=" + elem.uid + "&cid=" + elem.courtroom_id + "&flag=" + flag + "&city=" + r.court_id + "&court=" + r.court_id + "&vc=" + elem.courtId + '" >'
                        + '       <div class="row ">'
                        + '          <div class="col-xs-4">'
                        + '               <div class="left-tab-item-img-panel">'
                        + '                 <div class="left-tab-item-img">'
                        + '                      <p>' + elem.statusName + '</p>'
                        + '                       <img src="' + r.base_path + 'assets/img/list_test2.jpg" alt="法院">'
                        + '                   </div>'
                        + '               </div>'
                        + '          </div>'
                        + '          <div class="col-xs-8">'
                        + '              <div class="left-tab-item-content-panel">'
                        + '                  <p class="left-tab-item-content-panel-title">' + elem.casename + '</p>'
                        + '                  <p class="left-tab-item-content-panel-room">' + elem.courtroom_name + '</p>'
                        + '                  <p class="left-tab-item-content-panel-type">' + elem.casetype_name + '</p>'
                        + '                  <p class="left-tab-item-content-panel-time">' + startDate + '</p>'
                        + '              </div>'
                        + '          </div>'
                        + '      </div>'
                        + '  </a>'
                        + '     </div>';

                    $("#left-tab-1").find(".left-tab-row").append(html);
                });
                $("#left-tab-1").find(".cmp-left-tabs-link").find("a").attr("href", encodeURI(r.base_path + "views/more_courting.html?flag=" + flag + "&city=" + r.court_id + "&court=" + r.court_id));
                $("#left-tab-1").show();
            }
        },
        /**
         * 获取更多庭审回顾
         */
        _reviewCourt: function () {
            $.ajax({
                url: r.base_path + "getCaseInfoForReview",
                type: "get",
                dataType: "json",
                data: {
                    courtId: r.court_id
                },
                success: function (result) {
                    $("#review_link").attr("href", encodeURI(r.base_path + "views/more_reviewing.html?court=" + r.court_id));
                    $("#review_container").empty();
                    if (result && result.data) {
                        $.each(result.data, function (i, valueOfElement) {
                            var startDate = valueOfElement.start_date.substring(0, valueOfElement.start_date.length - 2);
                            var review_html = '<div class="col-xs-2">'
                                + '    <div class="cmp-bottom-reviewing-item">'
                                + '        <a href="' + r.base_path + "views/system_monitor/play.html?planId=" + valueOfElement.uid + "&city=" + r.court_id + "&court=" + r.court_id + "&vc=" + r.court_id + '">'
                                + '            <div class="cmp-bottom-reviewing-content">'
                                + '                <div class="cmp-bottom-reviewing-img-panel">'
                                + '                    <p>' + startDate + '</p>'
                                + '                    <img src="' + r.base_path + 'assets/img/more_court_test2.jpg" alt="...">'
                                + '                </div>'
                                + '                <p class="cmp-bottom-reviewing-content-text">';
                            if (valueOfElement.priorDate) {
                                review_html = review_html + ' <i id="' + valueOfElement.uid + '..' + r.court_id + '" class="fa fa-thumb-tack status-top"></i>';
                            } else {
                                review_html = review_html + ' <i id="' + valueOfElement.uid + '..' + r.court_id + '" class="fa fa-thumb-tack "></i>';
                            }
                            review_html = review_html + valueOfElement.casename + '</p>'
                                + '            </div>'
                                + '        </a>'
                                + '    </div>'
                                + '</div>'
                            $("#review_container").append(review_html);
                        });
                        var layer;
                        layui.use(['layer', 'form'], function () {
                            layer = layui.layer
                        });

                        $("#review_container").find(".fa-thumb-tack").click(function (e) {
                            e.preventDefault();
                            var cid = this.id.split('..');
                            var uid = cid[0];
                            if (this.className.indexOf("status-top") == -1) {
                                layer.confirm('想要置顶该点播吗？', {
                                    btn: ['是的', '取消'] //按钮
                                }, function () {
                                    $.post(r.base_path + "index/updateReview", {
                                        uid: uid,
                                        courtId: cid[1],
                                        favorite: true
                                    }, function (result) {
                                        layer.msg(result.msg);
                                        _reviewCourt();
                                    }, 'json')
                                }, function () {

                                });
                            } else {
                                layer.confirm('想要取消置顶该点播吗？', {
                                    btn: ['是的', '取消'] //按钮
                                }, function () {
                                    $.post(r.base_path + "index/updateReview", {
                                        uid: uid,
                                        courtId: cid[1],
                                        favorite: false
                                    }, function (result) {
                                        layer.msg(result.msg);
                                        _reviewCourt();
                                    }, 'json')
                                }, function () {

                                });
                            }
                        });
                    }
                }
            });
        },
        _initSumCount: function () {
            $.get(r.base_path + 'index/initSumCount', {
                courtUid: r.court_uid,
                startDate: ready.nowyear,
                endDate: utils.get_date(0),
                status: 0
            }, function (result) {
                $("#loading").hide();
                if (result && result.code == 0) {
                    if (result.data.nowOpen != 0) {
                        $("#_now").find("span").html("正在开庭数：" + result.data.nowOpen);
                    } else {
                        $("#_now").hide();
                    }
                    setInterval(Class._countCountNow, 1800000);

                    var typeNames = ["刑事", "民事", "行政", "执行", "信访", "其他"];
                    var a_href = ['a1', 'a2', 'a5', 'a3', 'a6', 'a7'];
                    var num = [0, 0, 0, 0, 0, 0, 0];
                    var total = 0;
                    var data = result.data;
                    $(result.data.sumOpen).each(function (i, n) {
                        total = total + (n.count ? n.count : 0);
                        n ? (typeNames.indexOf(n.name) >= 0 ? num[typeNames.indexOf(n.name)] = num[typeNames.indexOf(n.name)] + n.count : "") : "";
                        if (n.name == "赔偿") {
                            num[typeNames.indexOf("行政")] = num[typeNames.indexOf("行政")] + n.count;
                        }
                    });
                    $(typeNames).each(function (i, n) {
                        $("#_sumCount").find("tbody").find("td").eq(i).empty();
                        $("#_sumCount").find("tbody").find("td").eq(i).html('<a href=' + r.base_path + 'case_count/open_court_number_count?casetype=' + a_href[i] + '&courtUid=' + r.court_uid + '><span>' + n + "：" + num[i] + '</span></a>');
                    });
                    // console.log(data,total);
                    $("#_total").html(ready._nowyear.getFullYear() + "年01月01日 - " + (ready._nowyear.getMonth() + 1) + "月" + ready._nowyear.getDate() + "日 开庭总数 : " + total + '次');

                    var openCourtrooms = [];
                    var openCourtroomTotals = [];
                    $(result.data.sumOpenGroup).each(function (i, n) {
                        openCourtrooms.push(n.courtroomName);
                        var sum = 0;
                        $(n.data).each(function (i1, ele) {
                            sum = sum + ele.count;
                        })
                        openCourtroomTotals.push(sum);
                    });
                    // console.log(openDeptNames, openDeptTotals);
                    Class._countCountOpenEchart(openCourtrooms, openCourtroomTotals);

                    var courtroomUids = [];
                    var datas = [];
                    $(result.data.countTime).each(function (index, elem) {
                        courtroomUids.indexOf(elem.courtroomUid) != -1 ? "" : courtroomUids.push(elem.courtroomUid);
                        //typeNames.indexOf(elem.typename)!=-1?"":typeNames.push(elem.typename);
                    });

                    $(courtroomUids).each(function (index, ele) {
                        var temp = {};
                        var total = 0;
                        temp["courtroomUid"] = ele;
                        $(typeNames).each(function (index, elem) {
                            temp[elem] = 0;
                        });
                        $(result.data.countTime).each(function (index, elem) {
                            if (ele == elem.courtroomUid) {
                                temp["courtroomName"] = elem.courtroomName;
                                $(elem.data).each(function (index1, elem1) {
                                    total = (total * 10 + elem1.timeLong * 10) / 10;
                                    if ("未知" == elem1.typeName) {
                                        temp["其他"] = (temp["其他"] * 10 + elem1.timeLong * 10) / 10;
                                    } else if (elem1.typeName == "赔偿") {
                                        temp["行政"] = (temp["行政"] * 10 + elem1.timeLong * 10) / 10;
                                    } else {
                                        temp[elem1.typeName] = (temp[elem1.typeName] * 10 + elem1.timeLong * 10) / 10;
                                    }
                                });
                            }
                        });
                        temp["total"] = total;
                        datas.push(temp);
                    });
                    // datas.sort(function compare(a, b) {
                    //     return b.total - a.total;
                    // });
                    var xAxis = [];
                    var yAxis = [];
                    $(datas).each(function (index, elem) {
                        xAxis.push(elem.courtroomName);
                        yAxis.push(elem.total);
                    });
                    Class._countTimeOpenEchart(xAxis, yAxis);

                    Class.initTable(result.data.technologyCount[0].name, result.data.technologyCount[0].totalNum, result.data.technologyCount[0].num, result.data.technologyCount[0].rate);
                }
                else {
                    layer.msg(result.msg);
                    $("#_countCount_chart").html('<p class="text-center"><span>暂无数据</span></p>');
                    $("#_sumJudgeTrial").html('<p class="text-center"><span>暂无数据</span></p>')
                    $('#loading').hide();
                }
            }, 'json').fail(function () {
                layer.msg('加载失败!');
                $('#loading').hide();
            });
        },
        _countCountNow: function () {
            $.get(r.base_path + "index/countCountNow", {
                courtUid: r.court_uid,
                today: utils.get_date(0),
                status: 0
            }, function (result) {
                if (result.data > 0) {
                    $("#_now").find("span").html("正在开庭数：" + result.data);
                    $("#_now").show();
                } else {
                    $("#_now").hide();
                }
            });
            // setInterval(Class._countCountNow, 1800000);
        },
        _countCountOpenEchart: function (openCourtrooms, openCourtroomTotals) {
            if (!openCourtrooms || openCourtrooms.length == 0) {
                $("#_countCount_chart").html('<p class="text-center"><span>暂无数据</span></p>');
                return;
            }
            var option = {
                color: ['#3398DB'],
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                        type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                    }
                },
                grid: { // 控制图的大小，调整下面这些值就可以，
                    borderColor: "#1c4e93",
                    top: "10%",
                    x: '15%',
                    x2: '0',
                    y2: '17%',
                    y: 0
                },
                xAxis: [
                    {
                        type: 'category',
                        data: openCourtrooms,
                        axisLine: {
                            // show:false,
                            lineStyle: {
                                color: '#fff'
                            }
                        },
                        axisLabel: {
                            textStyle: {
                                color: "#b8e9ff",
                                fontSize: 16
                            },
                            interval: 0,
                            // rotate: -30,
                            formatter: function () {
                                return null;
                            }
                        },
                        axisTick: {
                            alignWithLabel: true
                        }
                    }
                ],
                yAxis: {
                    type: 'value',
                    splitNumber: 4,
                    //   min:1000,
                    axisLine: {
                        lineStyle: {
                            color: '#fff'
                        }
                    },
                    axisLabel: {
                        textStyle: {
                            color: "#b8e9ff",
                            fontSize: 14
                        },
                        formatter: function (val) {
                            if (val.length <= 3) {
                                return val;
                            }
                            if (!/^(\+|-)?(\d+)(\.\d+)?$/.test(val)) {
                                return val;
                            }
                            var a = RegExp.$1, b = RegExp.$2, c = RegExp.$3;
                            var re = new RegExp();
                            re.compile("(\\d)(\\d{3})(,|$)");
                            while (re.test(b)) {
                                b = b.replace(re, "$1,$2$3");
                            }
                            return a + "" + b + "" + c + '次';
                        }
                    },
                    axisTick: {
                        length: 2
                    }
                }
                ,
                series: [
                    {
                        name: "开庭次数",
                        barMaxWidth: 20,
                        type: 'bar',
//                barWidth: '60%',
                        itemStyle: {
                            normal: {
                                label: {
                                    show: true,
                                    position: 'top',
                                    textStyle: {
                                        color: "#0fffff",
                                        fontSize: 14
                                    }
                                }
                            }
                        },
                        data: openCourtroomTotals
                    }
                ]
            };
            ready._countCount_chart.setOption(option);
        },
        _countTimeOpenEchart: function (xdata, ydata) {
            // console.log(xdata, ydata);
            var option = {
                color: ['#D5B136'],
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                        type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                    }
                },
                grid: {
                    top: '5%',
                    left: '15%',
                    right: '0'
                    // bottom: '20%',
                    // containLabel: true
                },
                xAxis: {
                    data: xdata,
                    axisLine: {
                        lineStyle: {
                            color: "#1c4e93"
                        }
                    },
                    axisLabel: {
                        textStyle: {
                            color: "#FFFFFF"
                        },
                        interval: 0,
                        formatter: function (val) {
                            // return val.replace("市", "").replace("省", "");
                            return null;
                        }
                    }
                },
                yAxis: {
                    axisLine: {
                        lineStyle: {
                            color: "#1c4e93"
                        }
                    },
                    axisLabel: {
                        textStyle: {
                            color: "#FFFFFF"
                        },
                        formatter: function (val) {
                            if (val.length <= 3) {
                                return val;
                            }
                            if (!/^(\+|-)?(\d+)(\.\d+)?$/.test(val)) {
                                return val;
                            }
                            var a = RegExp.$1, b = RegExp.$2, c = RegExp.$3;
                            var re = new RegExp();
                            re.compile("(\\d)(\\d{3})(,|$)");
                            while (re.test(b)) {
                                b = b.replace(re, "$1,$2$3");
                            }
                            return a + "" + b + "" + c + 'h';
                        }
                    }
                },
                series: [{
                    name: '开庭数',
//            barWidth: '50%',
                    barMaxWidth: 20,
                    type: 'bar',
                    // itemStyle:{
                    //     normal:{
                    //         label:{
                    //             show:true,
                    //             position:'top',
                    //             textStyle: {
                    //                 color: "#d94600",
                    //                 fontSize:20
                    //             }
                    //         }
                    //     }
                    // },
                    data: ydata
                }]
            };
            // 使用刚指定的配置项和数据显示图表。
            ready._countTime_chart.setOption(option);
        },
        initTable: function (name, num, technology, bai) {
            $('#_technologyCourt').empty();
            var temp = ready._tec_copy.clone();
            // console.log(s[i]);
            temp.find("span").html(name);
            temp.find(".progress-bar").css("width", bai > 30 ? bai + "%" : 30 + "%");
            temp.find(".progress-bar").html(bai + '%');
            temp.find("span").eq(1).html(technology + "/" + num);
            $('#_technologyCourt').append(temp);
            $('#_technologyCourt').show();

        },
        sum_judge_echart: function (resultData) {
            var sum_judge = [];
            var sum_max = 1;
            $(resultData).each(function (i, elem) {
                elem.openTime > sum_max ? sum_max = elem.openTime : '';
                var judge = [];
                judge.push(elem.openNum);
                judge.push(elem.openTime);
                judge.push(elem.realName);
                sum_judge.push(judge);
                // users.push(n.username);
                // counts.push(n.sum);
                // nums.push(n.timelong);
            });
            // console.log(users, counts);
            var chart = echarts.init(document.getElementById('_sumJudgeTrial'), "macarons");
            var option = {
                grid: [{
                    show: false,
                    left: '9%',
                    right: '6%',
                    top: 30,
                    bottom: 20
                }],
                tooltip: {
                    padding: 10,
                    backgroundColor: '#222',
                    borderColor: '#777',
                    borderWidth: 1,
                    formatter: function (obj) {
                        var value = obj.value;
                        return '<div style="border-bottom: 1px solid rgba(255,255,255,.3); font-size: 18px;padding-bottom: 7px;margin-bottom: 7px">' +
                            '姓名：' + value[2] +
                            '</div>' +
                            '开庭次数：' + value[0] + '次<br>' +
                            '开庭时长：' + value[1] + '小时<br>';
                    }
                },
                xAxis: {
                    splitLine: {
                        show: false
                    },
                    axisLine: {
                        lineStyle: {
                            color: '#fff'
                        }
                    },
                    axisLabel: {
                        formatter: function (value) {
                            return value + '次'
                        }
                    }
                },
                yAxis: {
                    nameTextStyle: {
                        color: '#fff',
                        fontSize: 16
                    },
                    splitNumber: 4,
                    axisLine: {
                        lineStyle: {
                            color: '#eee',
                            show: false
                        }
                    },
                    axisLabel: {
                        formatter: function (value) {
                            return value + 'h'
                        }
                    },
                    splitLine: {
                        show: false
                    },
                    scale: true
                },

                series: [{
                    name: '开庭次数',
                    data: sum_judge,
                    type: 'scatter',
                    symbolSize: function (data) {
                        return (data[1] / sum_max) * 25 + 10;
                    },
                    label: {
                        emphasis: {
                            show: true,
                            formatter: function (param) {
                                return param.data[2];
                            },
                            position: 'top'
                        }
                    },
                    itemStyle: {
                        normal: {
                            color: '#009999'
                        }
                    }
                }]
            };
            chart.setOption(option);
            window.onresize = chart.resize;
        }

    };
    init();
    //TODO 对外公开的方法写在这里
    window.p = {
        init_judge_echart: Class.sum_judge_echart
    };
}(window);


